
/**
 * uni.showModal confirm
 */
function useModal(options = {}) {
  return new Promise((resolve, reject) => {
    uni.showModal(options).then(({ confirm }) => {
      if (!confirm) {
        reject(false);
      }

      resolve(true);
    });
  });
}

export default useModal;
